# docker stop jaeger

docker ps -a | grep "Exited" | awk '{print $1}' | xargs docker rm

if [[ "$(docker ps -a | awk '{print $2}' | grep jaeger)" != "" ]]; then
    echo "jaeger is running"
else
    docker run -d --name jaeger \
        -e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \
        -p 5775:5775/udp \
        -p 6831:6831/udp \
        -p 6832:6832/udp \
        -p 5778:5778 \
        -p 16686:16686 \
        -p 14250:14250 \
        -p 14268:14268 \
        -p 14269:14269 \
        -p 9411:9411 \
        jaegertracing/all-in-one
    echo "jaeger is starting"
fi
